---
id: 619665c9abd72906f3ad30f9
title: Hatua ya 1
challengeType: 0
dashedName: step-1
---

# --description--

Utakuwa unaunda Pengwini mwenye furaha wa Flappy, na ukichunguza zaidi mabadiliko na uhuishaji wa CSS katika mchakato.

Anza na boilerplate ya kawaida ya HTML. Jumuisha tamko la `DOCTYPE`, kipengele cha `html` chenye lugha iliyowekwa kwa Kiingereza, tagi zinazofaa za `meta`, `head`, `body`, na kipengele cha `title`. Pia, unganisha laha yako ya mtindo kwenye ukurasa.

# --hints--

Code yako unapaswa kuwa na tamko la `<!DOCTYPE html>`.

```js
assert(code.match(/<!DOCTYPE html>/i));
```

Code yako inapaswa kuwa na kipengele cha `html`.

```js
assert.equal(document.querySelectorAll('html')?.length, 1);
```

Kipengele chako cha `html` kinafaa kuwa na tagi ya ufunguzi yenye sifa ya `lang` ya `en`.

```js
assert(code.match(/<html\s+lang\s*=\s*('|")en\1\s*>/gi));
```

Kipengele chako cha `html` kinapaswa kuwa na tagi ya kufunga.

```js
assert(code.match(/<\/html\s*>/gi));
```

Unapaswa kuwa na kipengele cha `head` ndani ya kipengele chako cha `html`.

```js
assert.equal(document.querySelectorAll('head')?.length, 1);
```

Unapaswa kuwa na kipengele cha `body` ndani ya kipengele chako cha `html`.

```js
assert.equal(document.querySelectorAll('body')?.length, 1);
```

Kipengele chako cha `head` kinapaswa kuja kabla ya kipengele chako cha `body`.

```js
assert.equal(document.querySelector('body')?.previousElementSibling?.tagName, 'HEAD');
```

Unapaswa kuwa na vipengele viwili vya `meta`.

```js
const meta = document.querySelectorAll('meta');
assert.equal(meta?.length, 2);
```

Kipengele kimoja cha `meta` kinapaswa kuwa na `name` iliyowekwa kuwa `viewport`, na `content` iliyowekwa kuwa `width=device-width, initial-scale=1.0`.

```js
const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => m?.getAttribute('name') === 'viewport' && m?.getAttribute('content') === 'width=device-width, initial-scale=1.0' && !m?.getAttribute('charset'));
assert.exists(target);
```

Kipengele kingine cha `meta` kinafaa kuwa na sifa ya `charset` iliyowekwa kuwa `UTF-8`.

```js
const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => !m?.getAttribute('name') && !m?.getAttribute('content') && m?.getAttribute('charset')?.toLowerCase() === 'utf-8');
assert.exists(target);
```

Msimbo wako unapaswa kuwa na kipengele cha `title`.

```js
const title = document.querySelector('title');
assert.exists(title);
```

`title` yako inapaswa kuwa na maandishi.

```js
const title = document.querySelector('title');
assert.isAtLeast(title?.textContent?.length, 1);
```

Msimbo wako unapaswa kuwa na kipengele cha `link`.

```js
assert.exists(document.querySelector('link'));
```

Kipengele chako cha `link` kinapaswa kuwa ndani ya kipengele chako cha `head`.

```js
assert(code.match(/<head>[\w\W\s]*<link[\w\W\s]*\/?>[\w\W\s]*<\/head>/i));
```

Kipengele chako cha `link` kinapaswa kuwa na sifa ya `rel` yenye thamani ya `stylesheet`.

```js
const link_element = document.querySelector('link');
const rel = link_element.getAttribute("rel");
assert.equal(rel, "stylesheet");
```

Kipengele chako cha `link` kinafaa kuwa na sifa ya `href` yenye thamani `styles.css`.

```js
const link = document.querySelector('link');
assert.equal(link.dataset.href, "styles.css");
```

# --seed--

## --seed-contents--

```html
--fcc-editable-region--

--fcc-editable-region--
```

```css

```
